package com.ry.novel.enums;

import com.ry.novel.model.entity.SysUser;
import com.ry.novel.model.resp.IResultCode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author ry
 * @since 2022-01-21 21:07
 **/
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum ResponseStatus implements IResultCode {
    /**
     * 用户相关错误
     */
    No_LOGIN(1001,"未登录或登录失效！"),
    VEL_CODE_ERROR(1002,"验证码错误！"),
    USERNAME_EXIST(1003,"该用户名已经注册！"),
    USERNAME_PASSWORD_ERROR(1004,"用户名或密码错误！"),
    TWO_PASSWORD_DIFF(1005,"两次的密码不一致！"),
    OLD_PASSWORD_ERROR(1006,"旧密码错误！"),
    USER_BALANCE_NOT_ENOUGH(1007,"用户余额不足！"),
    USER_STATE_FORBIDDEN(1008,"用户被封禁了！"),

    /**
     * 作者相关错误
     */
    AUTHOR_STATE_FORBIDDEN(2001,"此作者已被封禁！"),
    NOT_REGISTER_AUTHOR(2002,"未成为作者"),

    /**
     * 小说相关错误
     */
    BOOK_NAME_EXISTS(3002,"已发布过同名小说"),
    BOOK_NOT_EXISTS(3002,"小说不存在"),



    /**
     * 文件相关错误
     */
    FILE_DIR_MAKE_FAIL(4001,"目录创建失败！"),
    FILE_TYPE_NOT_MATCH(4002,"请上传指定类型的文件！"),
    FILE_SIZE_LIMIT(4003,"文件大小超过限制！"),

    /**
     * 其他错误
     */
    METHOD_PARAM_ERROR(5001,"参数错误"),


    /**
     * 系统管理员错误
     */
    SYS_USER_DELETE_ERROR(6001,"无法删除此用户"),
    SYS_USER_UPDATE_ERROR(6002,"无法修改此用户"),

    /**
     * 管理系统相关错误
     */
    AUTHOR_DELETE_ERROR(7001,"无法删除此作者，此作者具有书籍"),
    CATEGORY_DELETE_ERROR(7002,"无法删除此分类，此分类有书籍");

    private Integer code;
    private String msg;
}
